<template>
  <n-data-table v-bind="bindValue" :bordered="false" :loading="loading" :checked-row-keys="checkedRowKeys"
                :row-key="row => row.id" size="large" :columns="columns" :data="data" flex-height
                @update:checked-row-keys="handleCheck">
    <template #empty>
      <n-space align="center" justify="center" vertical>
        <img :src="`${mainStore.commonImagePath}/empty_bg.svg`" alt="empty_bg">
        <n-text class="text-[#96A0B1]">暂无数据</n-text>
      </n-space>
    </template>
  </n-data-table>
</template>

<script setup>
import {computed, unref, useAttrs} from 'vue'
import {NDataTable} from 'naive-ui'
import {useMainStore} from '@/store'

const mainStore = useMainStore()
const attrs = useAttrs()
const bindValue = computed(() => ({...attrs, ...unref(NDataTable.props)}))
</script>

<style lang="less" scoped>
</style>
